package com.aat.dxfy.proxy.t01;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {
	
	private Object target=null;
	
	
	public MyInvocationHandler(Object target) {
		super();
		this.target = target;
	}

	/**
	 * Object invoke(Object proxy, Method method, Object[] args) throws Throwable

	proxy:　　指代我们所代理的那个真实对象
	method:　　指代的是我们所要调用真实对象的某个方法的Method对象
	args:　　指代的是调用真实对象某个方法时接受的参数
	 */
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		Object result = method.invoke(target, args);
		return result;
	}

}
